<?php

namespace app\validate;

use think\Validate;

class Register extends Validate
{
    protected $rule = [
        'usernum'   => 'require|max:25',
        'username'  => 'require|alphaNum|max:25',
        'password'  => 'require|min:6',
        'repassword'=> 'require|confirm:password',
        'userPhone' => 'require|mobile',
    ];

    protected $message = [
        'usernum.require'   => '学号是必填项',
        'usernum.max'       => '学号不能超过25个字符',
        'username.require'  => '用户名是必填项',
        'username.alphaNum' => '用户名只能由数字和字母组成',
        'username.max'      => '用户名不能超过25个字符',
        'password.require'  => '密码是必填项',
        'password.min'      => '密码不能少于6个字符',
        'repassword.require'=> '确认密码是必填项',
        'repassword.confirm'=> '密码不一致',
        'userPhone.require' => '电话号码是必填项',
        'userPhone.mobile'  => '请检查手机号码是否正确',
    ];
}
